package org.synclib.example.library;

import java.util.Arrays;
import java.util.List;

import org.synclib.model.SyncableObject;

public class Book extends SyncableObject {

	private final String isbn;
	
	public Book(String isbn) {
		super(null, System.currentTimeMillis());
		this.isbn = isbn;
	}

	@Override
	public String getUniqueId() {
		return this.isbn;
	}

	public String getTitle() {
		return (String) getProperty("title");
	}

	public void setTitle(String title) {
		setProperty("title", title);
	}

	public double getPrice() {
		return (Double) getProperty("price");
	}

	public void setPrice(double price) {
		setProperty("price", price);
	}

	@Override
	public List<String> getSyncableProperties() {
		return Arrays.asList("title", "price");
	}

}
